package com.sophia.web.component;

import org.apache.wicket.markup.html.WebPage;

import org.streets.eis.component.dropdown.MenuPanel;
import org.streets.eis.component.model.DataModel;
import org.streets.eis.component.model.MenuItem;


public class MenuPage extends WebPage
{
	private static final long serialVersionUID = 1L;

	public MenuPage()
	{
		
		MenuPanel menu = new MenuPanel("menu",createMenuModel());
		add(menu);
	}
	
	protected DataModel createMenuModel()
	{
		DataModel m = new DataModel();
		for (int i=0;i<10;i++){
			DataModel tmp = new DataModel(new MenuItem(String.valueOf(i),"Menu "+ String.valueOf(i),"url"+String.valueOf(i)));
			m.addChild(tmp);
			for (int j=0;j<5;j++){
				tmp.addChild(new DataModel(
						new MenuItem(String.valueOf(j),"Menu "+ String.valueOf(i)+"."+String.valueOf(j),"url"+String.valueOf(j))
						)
				);
			}
		}
		return m;
	}


}
